﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Upgrade
{
    public class TextView:System.Windows.Forms.TextBox
    {
        private const int WM_SETFOCUS = 0x7;

        [DllImport("user32", EntryPoint = "HideCaret")]
        private static extern bool HideCaret(IntPtr hWnd);
        //
        // 摘要:
        //     处理 Windows 消息。
        //
        // 参数:
        //   m:
        //     一个 Windows 消息对象。
        protected override void WndProc(ref Message m)
        {
            //if(m)
            base.WndProc(ref m);
        }

        protected override void OnGotFocus(EventArgs e)
        {
            base.OnGotFocus(e);
            HideCaret(Handle);
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            HideCaret(Handle);
        }

    }
}
